import { createStore, Store, useStore as baseUseStore } from 'vuex'
import { InjectionKey } from 'vue'

export interface State {
  count:number,
  foo:string
}

export const key: InjectionKey<Store<State>> = Symbol('store')

export const store = createStore<State>({
  state: {
    count: 0,
    foo: 'hello'
  },
  getters: {},
  mutations: {},
  actions: {},
  modules: {}
})

export const useStore = () => {
  return baseUseStore(key)
}
